<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.6.0.js"></script>
    <script>
        $(function (){
            $(":button").click(function(){
                var id=$("#stuId").val();
                $.ajax({
                    url:"/demo/query",
                    data:"id="+id,
                    dataType:"text",
                    success:function (resp){
                        alert(resp);
                    }
                })
            })
        })
    </script>
</head>
<body>
<input type="text" id="stuId">
<input type="button" value="query">
</body>
</html>